 
var serverName = "http://127.0.0.1:50057"; // rob VS

$(document).ready(function() {

	$( "#f001" ).autocomplete({
		source: function( request, response ) {
			$.ajax({
				url: serverName+"/ACBServiceProxy.svc/Autolookup", type: 'POST', dataType: 'json', contentType: 'application/json; charset="utf-8"',				
				data: '{"search":"' + request.term + '","type":"Title"}',
				success: function( msg ) {	response(msg.AutolookupResult);	}
			});
		}, minLength: 1 });

$("#f002").autocomplete({
		source: function( request, response ) {
			$.ajax({
				url: serverName+"/ACBServiceProxy.svc/Autolookup", type: 'POST', dataType: 'json', contentType: 'application/json; charset="utf-8"',				
				data: '{"search":"' + request.term + '","type":"Suburb"}',
				success: function( msg ) {	response(msg.AutolookupResult);	}
			});
		}, minLength: 1 });

$("#f003").autocomplete({
		source: function( request, response ) {
			$.ajax({
				url: serverName+"/ACBServiceProxy.svc/Autolookup", type: 'POST', dataType: 'json', contentType: 'application/json; charset="utf-8"',				
				data: '{"search":"' + request.term + '","type":"City"}',
				success: function( msg ) {	response(msg.AutolookupResult);	}
			});
		}, minLength: 1 });

$("#f004").autocomplete({
		source: function( request, response ) {
			$.ajax({
				url: serverName+"/ACBServiceProxy.svc/Autolookup", type: 'POST', dataType: 'json', contentType: 'application/json; charset="utf-8"',				
				data: '{"search":"' + request.term + '","type":"Code"}',
				success: function( msg ) {	response(msg.AutolookupResult);	}
			});
		}, minLength: 1 });



$("#f005").autocomplete({
		source: function( request, response ) {
			$.ajax({
				url: serverName+"/ACBServiceProxy.svc/Autolookup", type: 'POST', dataType: 'json', contentType: 'application/json; charset="utf-8"',				
				data: '{"search":"' + request.term + '","type":"Bank"}',
				success: function( msg ) {	response(msg.AutolookupResult);	}
			});
		}, minLength: 1 });

$("#f006").autocomplete({
		source: function( request, response ) {
			$.ajax({
				url: serverName+"/ACBServiceProxy.svc/Autolookup", type: 'POST', dataType: 'json', contentType: 'application/json; charset="utf-8"',
				data: '{"search":"' + request.term + '","type":"BranchName","bank":"' + document.getElementById('f005').value + '"}',
				success: function( msg ) {	response(msg.AutolookupResult);	}
			});
		}, minLength: 1 });

$("#f007").autocomplete({
		source: function( request, response ) {
			$.ajax({
				url: serverName+"/ACBServiceProxy.svc/Autolookup", type: 'POST', dataType: 'json', contentType: 'application/json; charset="utf-8"',
				data: '{"search":"' + request.term + '","type":"BranchCode","bank":"' + document.getElementById('f005').value + '"}',
				success: function( msg ) {	response(msg.AutolookupResult);	}
			});
		}, minLength: 1 });		
		
});